import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'

// 引入unocss
import '@unocss/reset/tailwind.css'
import '~/assets/style/index.css'
import 'uno.css'

import router from './router'

import i18n from '~/locales'

import '~/router/router-guard.ts'

/**
 * 解决浏览器警告：
 * dded non-passive event listener to a scroll-blocking 'wheel'
 * event. Consider marking event handler as 'passive' to make the page more responsive.
 * 安装这个依赖pnpm add default-passive-events -S
 * 在mein.js中导入即可
 * import 'default-passive-events'
 */
import 'default-passive-events'

const app = createApp(App)

const pinia = createPinia()

/**
 * 解决tailwind的样式冲突
 */
const meta = document.createElement('meta')
meta.name = 'naive-ui-style'
document.head.appendChild(meta)

app.use(router)
app.use(pinia)

// 多语言
app.use(i18n)

app.mount('#app')
